home *** CD-ROM | disk | FTP | other *** search
/ Champak 138 / Volume 138 Aug 19 2011 - Damaged.iso / Games / juicy_lucy.swf / scripts / DefineButton2_351 / BUTTONCONDACTION on(release).as
Text File  |  2011-08-19  |  1KB  |  49 lines

  1. on(release){
  2.    if(txtName1.text == "")
  3.    {
  4.       condition1 = "";
  5.       err.text = "Please fill in your name.";
  6.    }
  7.    else
  8.    {
  9.       condition1 = "ok";
  10.    }
  11.    if(txtCountry.text == "" and condition1 == "ok")
  12.    {
  13.       condition2 = "";
  14.       err.text = "Please fill in your country name.";
  15.    }
  16.    else
  17.    {
  18.       condition2 = "ok";
  19.    }
  20.    if(yourAge.text == "" and condition1 == "ok" and condition2 == "ok")
  21.    {
  22.       condition3 = "";
  23.       err.text = "Please fill in your age.";
  24.    }
  25.    else
  26.    {
  27.       condition3 = "ok";
  28.    }
  29.    if(condition1 == "ok" && condition2 == "ok" && condition3 == "ok")
  30.    {
  31.       trace("Name::" + txtName1.text);
  32.       trace("Score::" + score);
  33.       var result_lv1 = new LoadVars();
  34.       var my_lv1 = new LoadVars();
  35.       my_lv1.yourName1 = txtName1.text;
  36.       my_lv1.country = txtCountry.text;
  37.       my_lv1.age = yourAge.text;
  38.       my_lv1.yourScore = score;
  39.       result_lv1.onLoad = function(┬ºsuccess:Boolean┬º)
  40.       {
  41.          if(!success)
  42.          {
  43.          }
  44.       };
  45.       my_lv1.sendAndLoad("sendScore.php",result_lv1,"POST");
  46.       gotoAndStop("thankyou1");
  47.    }
  48. }
  49.